home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / sleep.z / sleep
Encoding:
Text File  |  1998-10-30  |  7.1 KB  |  132 lines

  1.  
  2.  
  3.  
  4. sssslllleeeeeeeepppp((((DDDD3333))))                                                            sssslllleeeeeeeepppp((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_llll_eeee_eeee_pppp - suspend process execution pending occurrence of an event
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_pppp_aaaa_rrrr_aaaa_mmmm_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  15.      _iiii_nnnn_tttt _ssss_llll_eeee_eeee_pppp_((((_cccc_aaaa_dddd_dddd_rrrr______tttt _e_v_e_n_t_,,,, _iiii_nnnn_tttt _f_l_a_g_s_))))_;;;;
  16.  
  17.    AAAArrrrgggguuuummmmeeeennnnttttssss
  18.      _e_v_e_n_t
  19.           Kernel address signifying an event for which the caller wishes to
  20.           wait.
  21.  
  22.      _f_l_a_g_s
  23.           Tells whether the sleep is interruptible or not.
  24.  
  25. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  26.      _ssss_llll_eeee_eeee_pppp suspends execution of a process to await certain events such as
  27.      reaching a known system state in hardware or software.  For instance,
  28.      when a process wants to read a device and no data are available, the
  29.      driver may need to call _ssss_llll_eeee_eeee_pppp to wait for data to become available before
  30.      returning.  This causes the kernel to suspend execution of the process
  31.      that called _ssss_llll_eeee_eeee_pppp and schedule another process.  The process that called
  32.      _ssss_llll_eeee_eeee_pppp can be resumed by a call to the _wwww_aaaa_kkkk_eeee_uuuu_pppp function with the same _e_v_e_n_t
  33.      specified as that used to call _ssss_llll_eeee_eeee_pppp.
  34.  
  35.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  36.      _ssss_llll_eeee_eeee_pppp returns _0000 if the caller woke up because of a call to _wwww_aaaa_kkkk_eeee_uuuu_pppp.  If
  37.      the sleep is interrupted by a signal the _ssss_llll_eeee_eeee_pppp call returns a value of _1111.
  38.  
  39. UUUUSSSSAAAAGGGGEEEE
  40.    eeeevvvveeeennnntttt AAAArrrrgggguuuummmmeeeennnntttt
  41.      The address has no significance except that the same address must be
  42.      passed to _wwww_aaaa_kkkk_eeee_uuuu_pppp(D3) to resume the sleeping process.  The address used
  43.      should be the address of a kernel data structure associated with the
  44.      driver, or one of the driver's own data structures.  Use of arbitrary
  45.      addresses not associated with a private data structure can result in
  46.      conflict with other, unrelated _ssss_llll_eeee_eeee_pppp and _wwww_aaaa_kkkk_eeee_uuuu_pppp operations in the kernel.
  47.  
  48.    ffffllllaaaaggggssss AAAArrrrgggguuuummmmeeeennnntttt
  49.      The value of the _f_l_a_g_s argument determines whether the sleep may be
  50.      interrupted by signals.  If the value of _f_l_a_g_s is less than or equal to
  51.      the value of the constant _PPPP_ZZZZ_EEEE_RRRR_OOOO (defined in _ssss_yyyy_ssss_////_pppp_aaaa_rrrr_aaaa_mmmm_...._hhhh), the sleeping
  52.      process will not be awakened by a signal.  If the value of _f_l_a_g_s is
  53.      greater than _PPPP_ZZZZ_EEEE_RRRR_OOOO the process will wake up prematurely (without a call
  54.      to _wwww_aaaa_kkkk_eeee_uuuu_pppp) upon receipt of a non-ignored, non-held signal and will
  55.      normally return _1111 to the calling code.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. sssslllleeeeeeeepppp((((DDDD3333))))                                                            sssslllleeeeeeeepppp((((DDDD3333))))
  69.  
  70.  
  71.  
  72.    GGGGeeeennnneeeerrrraaaallll CCCCoooonnnnssssiiiiddddeeeerrrraaaattttiiiioooonnnnssss
  73.      If a process were to sleep while it is manipulating global data inside a
  74.      critical section of driver code, it would be possible for another process
  75.      to execute base level driver code which manipulates the same data while
  76.      the first process was sleeping, resulting in data corruption.  A driver
  77.      should not sleep inside such a critical section unless it takes explicit
  78.      steps to prevent concurrent access to the data (for example, the driver
  79.      could implement its own locking protocol to protect the data).
  80.  
  81.      The value for _f_l_a_g_s should be selected based on whether or not a _wwww_aaaa_kkkk_eeee_uuuu_pppp
  82.      is certain to occur as well as the importance of the driver and of any
  83.      resources that the driver will hold after waking up.  If the driver is
  84.      holding or waiting for a critical kernel resource or is otherwise crucial
  85.      to the performance of the system, and the corresponding call to _wwww_aaaa_kkkk_eeee_uuuu_pppp is
  86.      guaranteed to happen, the driver should specify a _f_l_a_g_s argument less
  87.      than or equal to _PPPP_ZZZZ_EEEE_RRRR_OOOO.  If the driver is less performance critical or it
  88.      is possible that the _wwww_aaaa_kkkk_eeee_uuuu_pppp may not occur, the driver should specify a
  89.      _f_l_a_g_s argument greater than _PPPP_ZZZZ_EEEE_RRRR_OOOO.
  90.  
  91.      _ssss_llll_eeee_eeee_pppp will normally return a _1111 in the event of a signal, indicating that
  92.      the calling routine should perform any necessary cleanup and then return.
  93.  
  94.    LLLLeeeevvvveeeellll
  95.      Base only.
  96.  
  97.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  98.      Can sleep.
  99.  
  100.    NNNNooootttteeeessss
  101.      _ssss_llll_eeee_eeee_pppp and _wwww_aaaa_kkkk_eeee_uuuu_pppp are not appropriate to use in most multiprocessing
  102.      systems.  They are only useful if it is known that the driver or system
  103.      service will only ever execute on a particular processor.
  104.  
  105. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  106.      _wwww_aaaa_kkkk_eeee_uuuu_pppp(D3)
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.